/**
 * Created by mingxianjun on 2016-9-13.
 */
var express = require('express');
var port = process.env.PORT || 3000;

var app=express();
app.set('views','./views'); //设置视图的位置
app.set('view engine','jade');//设置默认的模版引擎为jade
app.listen(port);

console.log('node server started on port:'+port);
//页面路由
//index page
app.get('/',function(req,res){
    res.render('./pages/index',{
        title:'项目首页'
    });
});
//detail page
app.get('/movie/:id',function(req,res){
    res.render('./pages/detail',{
        title:'项目详情页'
    });
});
//list page
app.get('/admin/list',function(req,res){
    res.render('./pages/list',{
        title:'后台列表页'
    });
});
//admin page
app.get('/admin/movie',function(req,res){
    res.render('./pages/admin',{
        title:'后台录入页'
    });
});
